package com.dormitory.manage.controller;

import com.dormitory.manage.result.Result;
import com.dormitory.manage.service.BuildService;
import com.dormitory.manage.service.StudentDormitoryService;
import com.dormitory.manage.service.StudentService;
import com.dormitory.manage.service.UserService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Administrator
 * @version 1.0
 * @description 建筑控制层
 * @date 2023/4/8 0008 9:06
 */
@RestController
@RequestMapping("build")
@CrossOrigin
public class BuildController {
    @Resource
    private BuildService buildService;

    @GetMapping("getBuildNameList")
    public Result getBuildNames() {
        List<Integer> buildNames = this.buildService.getBuildNames();
        return Result.ok(buildNames);
    }

    @GetMapping("getBuilds")
    public Result getBuilds() {
        Long builds = this.buildService.getBaseMapper().selectCount(null);
        return Result.ok(builds);
    }

}
